n,m = map(int, input().split())
blocks = [0] + list(map(int, input().split()))
seasons = [0] + list(map(int, input().split()))
cbl = cse = 0
csb = css = 0
for s in range(1, sum(blocks)+1):
  if not blocks[cbl]:
    cbl += 1
    csb = 0
  if not seasons[cse]:
    cse += 1
    css = 0
  csb += 1
  blocks[cbl] -= 1
  css += 1
  seasons[cse] -= 1
  print("%dACV%02d S%02dE%02d" % (cbl, csb, cse, css))
  
